deploy: Use delete_if_present in can_soft_reboot
authorckyrouac <ckyrouac@redhat.com>
Wed, 8 Oct 2025 19:52:28 +0000 (15:52 -0400)
committerckyrouac <ckyrouac@redhat.com>
Tue, 14 Oct 2025 12:58:22 +0000 (08:58 -0400)
This avoids a dump when trying to delete the ostree= karg if it isn't
present. This is an issue with bootc factory reset.

Signed-off-by: ckyrouac <ckyrouac@redhat.com>
src/libostree/ostree-sysroot-deploy.c

index 3bfc8d9f52cc2194abdebd0bdcc281aaf112ae3b..81cc6b38cea18b82d7b88e2ae755c52eeea9a64c 100644 (file)
@@ -4389,8 +4389,8 @@ ostree_sysroot_deployment_can_soft_reboot (OstreeSysroot *self, OstreeDeployment
 
   // Compare kargs without the ostree= entry, as that will vary per bootlink even for
   // the same boot checksum.
-  g_assert (ostree_kernel_args_delete (booted_kargs, "ostree", NULL));
-  g_assert (ostree_kernel_args_delete (target_kargs, "ostree", NULL));
+  g_assert (ostree_kernel_args_delete_if_present (booted_kargs, "ostree", NULL));
+  g_assert (ostree_kernel_args_delete_if_present (target_kargs, "ostree", NULL));
   return _ostree_kernel_args_equal (booted_kargs, target_kargs);
 }